<template>
  <el-dialog :visible.sync="dialogVisible" width="600px" :before-close="handleClose" :close-on-click-modal="false" :show-close="false">
    <div class="box">

      <div class="rt-box">
        <h3>企业行业设置</h3>
        <p>
          1、系统为了更好的为你提供服务,请你对企业的行业类型进行设置
        </p>
        <p>
          2、此设置不会影响你的任何数据
        </p>
        <el-select v-model="industryid" clearable filterable>
          <el-option v-for="item in industryList" :key="item.id" :label="item.industryName" :value="item.id"></el-option>
        </el-select>
        <el-button type="primary" @click="onEditIndustry">确定</el-button>
      </div>
    </div>

  </el-dialog>
</template>
<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean
    }
  },
  data() {
    return {
      value: '',
      industryList: [],
      industryid: ''
    };
  },

  methods: {
    handleClose() {
      this.$emit("update:dialogVisible", false);
    },
    onEditIndustry() {
      if (!this.industryid) {
        this.$message({
          message: '你还没有选择所属行业',
          type: 'warning'
        });
        return;
      }
      this.$emit('onEditIndustry', this.industryid);
    },
    getindustryidList() {
      this.$api.publicApi.GetCompanyIndustryTemp().then(res => {
        let { data, message, status } = res.data;
        if (status == 200) {
          this.industryList = data;
        }

      }).catch(() => {

      });
    },
  },
  mounted() {
    this.getindustryidList();
  },
};
</script>
<style lang="less" scoped>
:deep( .el-dialog) {
  margin-top: 22vh !important;
}
:deep( .el-dialog__header) {
  background-color: #ffffff;
  padding: 0px;
  border: none;
}
:deep( .el-dialog__body) {
  padding: 0px !important;
}
:deep( .el-dialog__header) {
  height: 0px !important;
}
.box {
  width: 100%;
  height: 300px;
  background-image: url("../../../assets/images/homeImages/qiyeset.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  flex-direction: row-reverse;
  border-radius: 10px;
  .rt-box {
    width: 300px;
    height: 100%;
    padding: 10px 20px 10px 0px;
    color: black;
    h3 {
      font-size: 26px;
      font-weight: bold;
      margin-bottom: 10px;
      margin-top: 20px;
    }
    p {
      font-size: 14px;
      line-height: 30px;
    }
    .el-select {
      margin-top: 20px;
    }
    .el-button {
      width: 92%;
      height: 35px;
      line-height: 35px;
      margin-top: 20px;
    }
  }
}
</style>